<!DOCTYPE html>
<html th:lang="${#locale.language}" th:lang-direction="#{language.direction}" th:language="${#locale.toString()}" xmlns:th="http://www.thymeleaf.org">
  <head>
  <th:block th:insert="~{fragments/common :: head(title=#{pdfToImage.title}, header=#{pdfToImage.header})}"></th:block>
  </head>

  <body>
    <th:block th:insert="~{fragments/common :: game}"></th:block>
    <div id="page-container">
      <div id="content-wrap">
        <th:block th:insert="~{fragments/navbar.html :: navbar}"></th:block>
        <br /><br />
        <div class="container">
          <th:block th:insert="~{fragments/leftBar-doc2pdf.html :: leftBar-doc2pdf}"></th:block>
          <div class="container-context">
            <div class="card text-center">
              <div class="card-header card-header-cus">
                <h5 class="card-title" th:text="#{pdfToImage.header}"></h5>
              </div>
              <div class="card-body">
                <p th:text="#{processTimeWarning}"></p>
                <form method="post" enctype="multipart/form-data" th:action="@{api/v1/convert/pdf/img}">
                  <div th:replace="~{fragments/common :: fileSelector(name='fileInput', multiple=false, accept='application/pdf')}"></div>
                  <span style="color:#666;">PDF转图片属性设置：</span>
                  <hr/>
                  <div class="mb-3 row">
                    <label th:text="#{pdfToImage.selectText}" for="imageFormat" class="col-sm-2 col-form-label"></label>
                  <div class="col-sm-3">
                    <select class="form-control" name="imageFormat" id="imageFormat">
                      <option value="png">PNG</option>
                      <option value="jpg">JPG</option>
                      <option value="gif">GIF</option>
                      <option value="tiff">TIFF</option>
                      <option value="bmp">BMP</option>
                    </select>
                  </div>
                    <label th:text="#{pdfToImage.singleOrMultiple}" class="col-sm-3 col-form-label"></label>
                  <div class="col-sm-3">
                    <select class="form-control" name="singleOrMultiple">
                      <option value="single" th:text="#{pdfToImage.single}"></option>
                      <option value="multiple" th:text="#{pdfToImage.multi}"></option>
                    </select>
                  </div>
                  </div>
                  <div class="mb-3 row">
                    <label th:text="#{pdfToImage.colorType}"  class="col-sm-2 col-form-label"></label>
                    <div class="col-sm-3">
                    <select class="form-control" name="colorType">
                      <option value="color" th:text="#{pdfToImage.color}"></option>
                      <option value="greyscale" th:text="#{pdfToImage.grey}"></option>
                      <option value="blackwhite" th:text="#{pdfToImage.blackwhite}"></option>
                    </select>
                    </div>
                    <label for="dpi" class="col-sm-3 col-form-label">DPI:</label>
                    <div class="col-sm-3">
                      <input type="number" name="dpi" class="form-control" id="dpi" min="1" step="1" value="300" required>
                    </div>
                  </div>

                  <button type="submit" id="submitBtn" class="btn btn-primary convertBtn" th:text="#{pdfToImage.submit}"></button>
                </form>
              </div>
            </div>
          </div>
        </div>
      </div>
      <th:block th:insert="~{fragments/footer.html :: footer}"></th:block>
    </div>
  </body>
</html>
